<template>
	<view class="contain">
		<view class="card-contain">
			<view class=" card-public">
				<text>店铺号：{{detailInfo.storeId}}</text>
				<text>联系人：{{detailInfo.connectorName}}/{{detailInfo.connectorPhone}}</text>
				<text>店铺地址：{{detailInfo.address}}</text>
			</view>

			<view class="zong card-public">
				<view class="user_box" style="width: 80%; margin: 40rpx auto;">
					<view class="user_for" v-for="(list,id) in remarklist" :key="id">
						<view class="line_box">
							<!--圆球 -->
							<view class="line_radio"
								:style="{ 'background' : list.istrue ? '#ef6f16' : '#8e8b8d' , 'border' : list.istrue ? 'solid 6rpx #fbc293' : 'solid 6rpx #b9b7b6'}">
							</view>
							<!-- 线 -->
							<view class="line_for" v-for="item in 3" :key="item"
								:style="{ 'background' : list.istrue ? '#ef6f16' : '#8e8b8d'}"></view>
						</view>
						<view class="right_box" :style="{ 'color' : list.istrue ? '#ef6f16' : '#8e8b8d'}">
							<view class="title">{{list.title}} <text style="margin-left: 20rpx;" v-if="list.title1"
									@click="Jump(list)">({{list.title1}})</text></view>
							<view class="desc">
								{{list.desc}}
							</view>
						</view>
					</view>
				</view>
			</view>

			<view class="card-public">
				<view class="child-card-public">
					开店图纸
				</view>
				<view class="image-item" v-for="(item,index) in fileList0" :key="index">
					<view class="image-content">
						<image style="width: 200px; height: 200px; background-color: #eeeeee;" :src="item.url"></image>
					</view>
					<view class="image-title">{{item.text}}</view>
				</view>
			</view>
			<view class="card-public">
				<view class="child-card-public">
					<text>确认进场时间：</text>
					<text @click=" canchange&&(arriveTimeShow= true)">{{item.arriveTime}}</text>
					<u-datetime-picker @confirm="arriveTimeConfirm" :show="arriveTimeShow" mode="datetime"
						:minDate="1587524800000" :maxDate="1786778555000">
					</u-datetime-picker>

				</view>
				<view class="child-card-public">
					是否收到货物：
					<radio-group @change="isGetChange" style="display:inline-block;">
						<label class="uni-list" v-for="(Item, index) in isGetChoose" :key="index">
							<radio :disabled="!canchange" :value="Item.value" :checked="Item.value == item.isGet" />
							<text style="margin-right: 10px;">{{Item.name}}</text>
						</label>
					</radio-group>
				</view>
				<view class="child-card-public">
					<text>核对点时间：</text>
					<text @click=" canchange&&(isOptionalDateShow = true)">{{item.isOptionalDate}}</text>
					<u-datetime-picker :disabled="!canchange" @cancel="isOptionalDateShow = false"
						@confirm="isOptionalDateConfirm" :show="isOptionalDateShow" mode="datetime"
						:minDate="1587524800000">
					</u-datetime-picker>
				</view>
			</view>

			<view class="card-public">
				<view class="child-card-public">
					核对点现场图片
				</view>
				<view class="">
					<u-upload :disabled="!canchange" :deletable="canchange" :fileList="fileList1" @afterRead="afterRead"
						@delete="deletePic" name="1" multiple :maxCount="10"></u-upload>
				</view>
			</view>
			<view class="card-public">
				<view class="child-card-public">
					<text>综合布线时间：</text>
					<text @click="canchange&&(wireStateTimeShow= true)">{{item.wireStateTime}}</text>
					<u-datetime-picker :disabled="!canchange" @cancel="wireStateTimeShow = false"
						@confirm="wireStateTimeConfirm()" :show="wireStateTimeShow" mode="datetime"
						:minDate="1587524800000" >
					</u-datetime-picker>

				</view>
				<view class="child-card-public"> 综合布线状态:
					<u--input :disabled="!canchange" v-model="item.wireState" placeholder="请输入" clearable />
				</view>
				<view class="child-card-public">弱点端接状态:
					<u--input :clickable="!canchange" v-model="item.eleState" placeholder="请输入" clearable />
				</view>
				<view class="child-card-public">机柜到场状态:
					<radio-group @change="iseqIsPresentChange" style="display:inline-block;">
						<label class="uni-list-cell uni-list-cell-pd" v-for="(Item, index) in iseqIsPresent"
							:key="index">
							<radio :disabled="!canchange" :value="Item.value"
								:checked="Item.value == item.eqIsPresent" />
							<text style="margin-right: 10px;">{{Item.name}}</text>
						</label>
					</radio-group>
				</view>
				<view class="child-card-public">
					<text>机柜到场时间: </text>
					<text @click="canchange&&(eqIsOptionalTimeShow= true)">{{item.eqIsOptionalTime}}</text>
					<u-datetime-picker @cancel="eqIsOptionalTimeShow = false" @confirm="eqIsOptionalTimeConfirm()"
						:show="eqIsOptionalTimeShow" mode="datetime" :minDate="1587524800000" >
					</u-datetime-picker>

				</view>
				<view class="child-card-public">签单状态:
					<u--input :clickable="!canchange" v-model="item.signState" placeholder="请输入" clearable
						@change="logSingState" />
				</view>
			</view>
			<view class="card-public">
				<text>现场验收图片：</text>
				<u-upload :disabled="!canchange" :deletable="canchange" :fileList="fileList2" @afterRead="afterRead"
					@delete="deletePic" name="2" multiple :maxCount="10"></u-upload>
			</view>
			<view v-if="canchange" class="card-public">
				<text>工程师现场反馈：</text>
				<u--input placeholder="请输入:" height="10rpx" type="textarea" v-model="orderRemark.remark" clearable>
				</u--input>
			</view>
			<view v-if="canchange" class="sub">
				<u-button type="primary" @click="save" text="保存草稿"></u-button>
				<u-button type="primary" @click="sub" text="提交"></u-button>
			</view>
		</view>
	</view>
</template>

<script>
	import request from '../../../utils/request.js'
	export default {
		data() {
			return {
				canchange: true,
				BaseUrl: "",
				item: {
					isGet: false, //是否收到货物
					arriveTime: this.gettime(), //确认进场时间
					isOptionalDate: this.gettime(), //核对点位时间
					wireStateTime: this.gettime(), //综合布线状态 时间
					wireState: '', //综合布线状态
					eleState: '', //弱电端接状态
					eqIsPresent: false, //机柜到场状态
					eqIsOptionalTime: this.gettime(), //机柜到场日期 时间
					signState: '', //签单状态

					// serialNumber: null, //序列号
					// faultEquipment: null, //MA故障设备

					// faultClass: null, //MA故障分类	
					// faultCode: null, //MA故障代码	
					// soluteCode: null, //MA解决代码	
					// repairType: "Onsite", //MA解决类型

					workOrderId: null,
					finishTime: null,
					workOrderStatus: 20, //工单状态
					workOrderTypeId: null //工单类型

				},
				arriveTimeShow: false,
				isOptionalDateShow: false,
				wireStateTimeShow: false,
				eqIsOptionalTimeShow: false,
				isGetChoose: [{
						value: true,
						name: '是'
					},
					{
						value: false,
						name: '否'
					}
				],
				iseqIsPresent: [{
						value: 'true',
						name: '已到场'
					},
					{
						value: 'false',
						name: '未到场'
					}
				],
				workOrderImagesBos: [],
				detailInfo: {},
				remarkinfo: {},
				fileList0: [],
				fileList1: [],
				fileList2: [],
				remarklist: [],
				orderRemark: {
					remarkType: 13,
					remark: undefined,
					workOrderId: undefined
				},
				value: null,
				show: {
					show1: false,
					show2: false,
					show3: false,
					show4: false,
				},
				// //MA故障分类
				// faultClassName: this.$store.state.mafa.ma_fault_class,
				// //MA故障代码
				// faultCode: this.$store.state.mafa.ma_fault_code,
				// //MA解决代码
				// soluteCode:this.$store.state.mafa.ma_solute_code,
				// //MA解决类型
				// repairType: this.$store.state.mafa.repair_type //remote Onsite
			};
		},
		computed: {
			// remarktitle() {
			// 	switch (this.detailInfo.workOrderTypeId) {
			// 		case 1:
			// 			return "派单备注"
			// 		case 5:
			// 			return "申请转单备注"
			// 		case 10:
			// 			return "拒绝转单理由"
			// 		case 15:
			// 			return "审核驳回理由"
			// 		case 13:
			// 			return "工程师现场反馈"
			// 		case 20:
			// 			return "项目经理备注"
			// 		default:
			// 			return "备注字典找不到"
			// 	}
			// },
			workid() {
				return this.detailInfo.workOrderId[0] + this.detailInfo.workOrderId[1] + this.detailInfo.workOrderId[2]
			}
		},
		onLoad(option) {
			uni.showLoading({
				title: '正在加载中'
			})
			this.mountSelect(option.workOrderId)
			this.BaseUrl = getApp().globalData.BaseUrl
			// this.getDict("ma_fault_class")
			if (option.canchange == "true") {
				this.canchange = true
			} else {
				this.canchange = false
			}
			// uni.getStorageSync(option.workOrderId)
			// uni.removeStorageSync('item');
		},
		// onReady() {
		// 	// 微信小程序需要用此写法
		// 	this.$refs.datetimePicker1.setFormatter(this.formatter)
		// },
		methods: {
			changeTime(value) {
				const time = new Date(value)
				let year = time.getFullYear() + ''
				let month = (time.getMonth() + 1) + ''
				let date = time.getDate() + ''
				let h = time.getHours() + ''
				let m = time.getMinutes() + ''
				let s = time.getSeconds() + ''
				month = month > 9 ? month : '0' + month;
				date = date > 9 ? date : '0' + date;
				s = s > 9 ? s : '0' + s
				m = m > 9 ? m : '0' + m
				const tt = year + "-" + month + "-" + date + " " + h + ":" + m + ":" + s;
				return tt
			},
			arriveTimeConfirm(evt) {
				this.item.arriveTime = this.changeTime(evt.value)
				this.arriveTimeShow = false
			},
			isOptionalDateConfirm(evt) {
				this.item.isOptionalDate = this.changeTime(evt.value)
				this.isOptionalDateShow = false
			},
			wireStateTimeConfirm(evt) {
				this.item.wireStateTime = this.changeTime(evt.value)
				this.wireStateTimeShow = false
			},
			eqIsOptionalTimeConfirm(evt) {
				this.item.eqIsOptionalTime = this.changeTime(evt.value)
				this.eqIsOptionalTimeShow = false
			},

			formatter(type, value) {
				if (type === 'year') {
					return `${value}年`
				}
				if (type === 'month') {
					return `${value}月`
				}
				if (type === 'day') {
					return `${value}日`
				}
				return value
			},
			logSingState() {
				console.log('singState:', this.item.signState);
			},
			isGetChange(evt) {
				console.log('isGetChange方法', evt.detail.value);
				this.item.isGet = evt.detail.value;
				console.log(this.item.isGet);
			},
			iseqIsPresentChange(evt) {
				console.log('iseqIsPresentChange方法', evt.detail.value);
				this.item.eqIsPresent = evt.detail.value;
				console.log(this.item.eqIsPresent);
			},
			changeArriveTime(e) {
				this.item.arriveTime = e.detail.value
			},
			changeisOptionalDate(e) {
				this.item.isOptionalDate = e.detail.value
			},
			changewireStateTime(e) {
				this.item.wireStateTime = e.detail.value
			},
			changeeqIsOptionalTime(e) {
				this.item.eqIsOptionalTime = e.detail.value
			},
			getDate(type) {
				const date = new Date();
				let year = date.getFullYear();
				let month = date.getMonth() + 1;
				let day = date.getDate();

				if (type === 'start') {
					year = year - 60;
				} else if (type === 'end') {
					year = year + 2;
				}
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				return `${year}-${month}-${day}`;
			},
			getHour() {
				var nowdate = new Date();
				var h = nowdate.getHours()
				var m = nowdate.getMinutes()
				var s = nowdate.getSeconds()
				return `${h}:${m}:${s}`;
			},

			// select(item, num) {
			// 	console.log("select", num, item.detail)
			// 	switch (num) {
			// 		case 1:
			// 			this.item.faultClass = item.detail.value;
			// 			break;
			// 		case 2:
			// 			this.item.faultCode = item.detail.value;
			// 			break;
			// 		case 3:
			// 			this.item.soluteCode = item.detail.value;
			// 			break;
			// 		case 4:
			// 			item.detail.value == 0 ? this.item.repairType = "remote" : this.item.repairType = "onSite"
			// 			break;
			// 	}
			// },
			// getDict(dictType) {
			// 	request({
			// 		url: "prod-api/system/dict/data/type/" + dictType,
			// 		method: "get",
			// 	}).then((res) => {
			// 		console.log("dict", res)
			// 	})
			// },
			gettime() {
				var nowdate = new Date();
				var year = nowdate.getFullYear()
				var month = nowdate.getMonth() + 1
				var date = nowdate.getDate()
				var day = nowdate.getDay()
				var h = nowdate.getHours()
				var m = nowdate.getMinutes()
				var s = nowdate.getSeconds()
				month = month > 9 ? month : '0' + month;
				day = day > 9 ? day : '0' + day;
				var nowtime = year + "-" + month + "-" + date + " " + h + ":" + m + ":" + s;
				return nowtime
			},
			async confirm(e, id) {
				console.log('confirm', e)
				if (id == 1) {
					if (e.value[0] == "其他") {
						this.item.faultClass = "100"
						this.closeSelect()
					} else {
						this.item.faultClass = e.indexs[0].toString()
						this.closeSelect()
					}
				} else if (id == 2) {
					this.item.faultCode = e.indexs[0].toString()
					await this.closeSelect()
				} else if (id == 3) {
					this.item.soluteCode = e.indexs[0].toString()
					await this.closeSelect()
				} else if (id == 4) {
					if (e.value[0] == "远程") {
						this.item.repairType = "remote"
						await this.closeSelect()
					} else if (e.value[0] == "上门") {
						this.item.repairType = "Onsite"
						await this.closeSelect()
					}

				}

			},
			closeSelect() {
				this.show.show1 = false
				this.show.show2 = false
				this.show.show3 = false
				this.show.show4 = false
			},
			clearLocal() {
				uni.removeStorageSync(this.detailInfo.workOrderId)
				uni.removeStorageSync(this.detailInfo.workOrderId + "img")
				uni.removeStorageSync(this.detailInfo.workOrderId + "filelist1")
				uni.removeStorageSync(this.detailInfo.workOrderId + "filelist2")
				uni.removeStorageSync(this.detailInfo.workOrderId + "item")
			},
			//提交
			sub() {
				// uni.removeStorageSync(this.detailInfo.workOrderId)
				// uni.removeStorageSync(this.detailInfo.workOrderId + "img")
				// uni.removeStorageSync(this.detailInfo.workOrderId + "filelist1")
				// uni.removeStorageSync(this.detailInfo.workOrderId + "filelist2")
				// uni.removeStorageSync(this.detailInfo.workOrderId + "item")
				this.item.workOrderId = this.detailInfo.workOrderId
				this.item.finishTime = this.gettime()
				var obj = this.item
				for (var key in obj) {
					if (obj[key] == null) {
						delete obj[key]
					}
				}
				this.item = obj
				if (this.workid == "KOa") {
					this.adopen()
				} else if (this.workid == "KOl") {
					this.lvopen()
				} else if (this.workid == "KCa") {
					this.adclose()
				} else if (this.workid == "KCl") {
					this.lvclose()
				} else if (this.workid == "KMa") {
					this.adma()
				} else if (this.workid == "KMl") {
					this.lvma()
				} else if (this.workid == "KOO") {
					this.koo()
				} else if (this.workid == "KMr") {
					this.rgma()
				}
			},
			//保存草稿
			save() {
				uni.setStorage({
					key: this.detailInfo.workOrderId, // 存储值的名称
					data: this.item, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "img", // 存储值的名称
					data: this.workOrderImagesBos, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "filelist1", // 存储值的名称
					data: this.fileList1, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "filelist2", // 存储值的名称
					data: this.fileList2, //   将要存储的数据
					success: res => {
						// 成功后的回调
					}
				});
				uni.setStorage({
					key: this.detailInfo.workOrderId + "item", // 存储值的名称
					data: this.item, //   将要存储的数据
					success: res => {
						console.log(this.item);
						// 成功后的回调
					}
				});
				uni.switchTab({
					url: '/pages/home/index'
				})

			},
			get(option) {
				uni.getStorage({
					key: option.workOrderId, // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.item = res.data // hello  这里可做赋值的操作 
					}
				})
				uni.getStorage({
					key: option.workOrderId + "img", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.workOrderImagesBos = res.data // hello  这里可做赋值的操作
					}
				})
				uni.getStorage({
					key: option.workOrderId + "filelist1", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.fileList1 = res.data // hello  这里可做赋值的操作 
					}
				})
				uni.getStorage({
					key: option.workOrderId + "filelist2", // 储存在本地的变量名
					success: res => {
						// 成功后的回调
						this.fileList2 = res.data // hello  这里可做赋值的操作
					}
				})
				uni.getStorage({
					key: option.workOrderId + "item", // 储存在本地的变量名
					success: res => {
						console.log(res);
						// 成功后的回调
						this.item = res.data // hello  这里可做赋值的操作
					}
				})
			},
			// 删除图片
			deletePic(event) {
				this[`fileList${event.name}`].splice(event.index, 1)
			},
			// 新增图片
			async afterRead(event) {
				// 当设置 mutiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this[`fileList${event.name}`].length
				lists.map((item) => {
					this[`fileList${event.name}`].push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url, event.name)
					let item = this[`fileList${event.name}`][fileListLen]
					this[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
			},
			uploadFilePromise(url, name) {

				return new Promise((resolve, reject) => {
					uni.$u.http.upload(`${this.BaseUrl}/prod-api/system/oss/upload`, {
						params: {},
						/* 会加在url上 */
						// #ifdef APP-PLUS || H5
						files: [], // 需要上传的文件列表。使用 files 时，filePath 和 name 不生效。App、H5（ 2.6.15+）
						// #endif
						filePath: url, // 要上传文件资源的路径。
						// 注：如果局部custom与全局custom有同名属性，则后面的属性会覆盖前面的属性，相当于Object.assign(全局，局部)
						custom: {
							auth: true
						}, // 可以加一些自定义参数，在拦截器等地方使用。比如这里我加了一个auth，可在拦截器里拿到，如果true就传token
						name: 'file', // 文件对应的 key , 开发者在服务器端通过这个 key 可以获取到文件二进制内容
						// #ifdef H5 || APP-PLUS
						timeout: 60000, // H5(HBuilderX 2.9.9+)、APP(HBuilderX 2.9.9+)
						// #endif
						header: {
							Authorization: uni.getStorageSync("token")
						},
						/* 会与全局header合并，如有同名属性，局部覆盖全局 */
						formData: {}, // HTTP 请求中其他额外的 form data
						// 返回当前请求的task, options。请勿在此处修改options。非必填
						getTask: (task, options) => {},
					}).then((res) => {
						if (name == 1) {
							this.workOrderImagesBos.push({
								imagePath: res.data.data.url.replace("blob:", ""),
								imageTypeId: "5",
								workOrderId: this.detailInfo.workOrderId
							})
						} else if (name == 2) {
							this.workOrderImagesBos.push({
								imagePath: res.data.data.url.replace("blob:", ""),
								imageTypeId: "10",
								workOrderId: this.detailInfo.workOrderId
							})
						}
						resolve(res.data.data.url)
						// 返回的res.data 已经进行JSON.parse
					}).catch(err => {

					})


					// let a = uni.uploadFile({
					// 	url: 'http://192.168.2.21:7001/upload', // 仅为示例，非真实的接口地址
					// 	filePath: url,
					// 	name: 'file',
					// 	formData: {
					// 		user: 'test'
					// 	},
					// 	success: (res) => {
					// 		setTimeout(() => {
					// 			resolve(res.data.data)
					// 		}, 1000)
					// 	}
					// });
				})
			},

			//请求有关
			async mountSelect(workOrderId) {
				await request({
					url: "prod-api/system/ad-workOrder/" + workOrderId,
					method: "get",
				}).then((res) => {
					console.log('mountSelect方法:', res.data);
					if (res.code < 300) {
						if (workOrderId[1] === "O") {
							this.detailInfo = res.data.selectAdOpenWorkOrderVo
							this.remarkinfo = res.data.workOrderRemarkVo
							if (!this.canchange) {
								this.item = res.data.selectAdOpenWorkOrderVo
								console.log('this.item:', this.item);
							}
							this.doremark(res.data.workOrderRemarkVos)
							res.data.workOrderImagesVos.forEach((item, index) => {
								console.log(item);
								if (item.imageTypeId == "10") {
									this.fileList2.push({
										type: "image",
										url: item.imagePath,
										status: "success",
										name: "",
										message: "",
										thumb: "",
										size: 60489
									})
								} else if (item.imageTypeId == '5') {
									this.fileList1.push({
										type: "image",
										url: item.imagePath,
										status: "success",
										name: "",
										message: "",
										thumb: "",
										size: 60489
									})
								} else if (item.imageTypeId == '20') {
									this.fileList0.push({
										type: "image",
										url: item.imagePath,
										status: "success",
										name: "",
										message: "",
										thumb: "",
										size: 60489
									})
									this.workOrderImagesBos.push({
										imagePath: item.imagePath,
										imageTypeId: "20",
										workOrderId: this.detailInfo.workOrderId
									})
								}
							})
						} else if (workOrderId[1] === "C") {
							this.detailInfo = res.data.selectAdCloseWorkOrderVo
						} else if (workOrderId[1] === "M") {
							// this.detailInfo = res.data.selectAdMaWorkOrderVo
							// this.remarkinfo = res.data.workOrderRemarkVo
							// this.item.faultClass = res.data.selectAdMaWorkOrderVo.faultClass
							// this.item.faultCode = res.data.selectAdMaWorkOrderVo.faultCode
							// this.item.soluteCode = res.data.selectAdMaWorkOrderVo.soluteCode
							// this.item.repairType = res.data.selectAdMaWorkOrderVo.repairType
							// this.item.serialNumber = res.data.selectAdMaWorkOrderVo.serialNumber
							// this.item.faultEquipment = res.data.selectAdMaWorkOrderVo.faultEquipment


						}
					}
				}).then((res) => {
					uni.hideLoading()
				})

				await this.get({
					workOrderId
				})
			},
			//导出订单图片
			downImages(type) {
				// if(type=="导出PDF图纸"){
				// 	var paramsData={
				// 		imageTypeId: "20",
				// 		workOrderId: this.detailInfo.workOrderId
				// 	}
				// }else if(type=="导出设备清单"){
				// 	var paramsData={
				// 		imageTypeId: "25",
				// 		workOrderId: this.detailInfo.workOrderId
				// 	}
				// }
				request({
					url: "prod-api/system/orderImages/downloadList?imagesBos=" + this.detailInfo.workOrderId,
					method: "get",
				}).then((res) => {
					console.log(res)
					if (res.code < 300) {
						uni.downloadFile({
							url: res.data,
							success: (res) => {
								if (res.statusCode === 200) {
									uni.saveImageToPhotosAlbum({
										filePath: res.tempFilePath,
										success: function() {
											uni.showToast({
												title: "保存成功",
												icon: "none"
											});
										},
										fail: function() {
											uni.showToast({
												title: "保存失败，请稍后重试",
												icon: "none"
											});
										}
									});
								}
							}
						})
					}
				})
			},

			adma() {
				this.item.workOrderTypeId = 1
				console.log(this.item)
				console.log(this.workOrderImagesBos)
				this.orderRemark.workOrderId = this.item.workOrderId
				request({
					url: "prod-api/system/orderRemark",
					method: "post",
					data: this.orderRemark
				}).then((res) => {
					console.log(res)
				})
				request({
					url: "prod-api/system/ad-workOrder",
					method: "put",
					data: {
						updateAdMaWorkOrderBo: this.item,
						workOrderImagesBos: this.workOrderImagesBos
					}
				}).then((res) => {
					console.log(res)
					if (res.code < 300) {
						this.clearLocal()
						uni.switchTab({
							url: '/pages/home/index'
						})
					}
				})
			},
			adopen() {
				this.item.workOrderTypeId = 0
				console.log(this.item)
				console.log(this.workOrderImagesBos)
				this.orderRemark.workOrderId = this.item.workOrderId
				request({
					url: "prod-api/system/orderRemark",
					method: "post",
					data: this.orderRemark
				}).then((res) => {
					console.log(res)
				})
				request({
					url: "prod-api/system/ad-workOrder",
					method: "put",
					data: {
						updateAdOpenWorkOrderBo: this.item,
						workOrderImagesBos: this.workOrderImagesBos
					}
				}).then((res) => {
					console.log(res)
					if (res.code < 300) {
						this.clearLocal()
						uni.switchTab({
							url: '/pages/home/index'
						})
					}
				})
			},
			doremark(data = []) {
				console.log(data)
				data.forEach((item, index) => {
					this.remarklist.push({
						id: index,
						title: item.remarkTypeName,
						title1: "",
						desc: item.remark,
						isture: true,
						url: ""
					})
				})
				console.log(this.remarklist)
			}
		}
	}
</script>

<style lang="scss">
	.contain {
		width: 100%;
		height: 100%;
		position: absolute;
		background-color: rgb(245, 245, 245);

		.card-contain {
			.card-public {
				display: flex;
				flex-direction: column;
				background-color: white;
				justify-content: space-between;
				width: 90%;
				margin: 30upx 5%;
				box-sizing: border-box;
				padding: 10upx 0;
				padding-left: 40upx;
				border-radius: 30upx 30upx 30upx 30upx;
				box-shadow: 0 0 15px rgb(232, 232, 232);

				.child-card-public {
					border-bottom: 1px solid gray;
					margin: 10px 0;
					padding: 5px 0;
				}

				.textline {
					border-bottom: 1px solid rgb(218, 219, 222);
					color: rgb(192, 196, 204);
					width: 100%;
					line-height: 60upx;
					font-size: 30rpx;
				}

				.radio {
					margin-top: 20upx;
				}

				text {
					font-size: 32upx;
					margin-top: 8upx;
					margin-bottom: 20upx;
				}
			}

			.btn {
				display: flex;
			}

		}

		.sub {
			display: flex;
			justify-content: space-between;

			button {
				width: 300upx;
				height: 60upx;
			}

			padding-bottom: 100upx;
		}
	}

	.zong {

		.user_for {
			display: flex;
		}

		.item_year {
			font-size: 34rpx;
			height: 50rpx;
		}

		.line_for {
			width: 4rpx;
			height: 24rpx;
			margin: 0 20rpx 10rpx;
			background-color: #559DFF;
		}

		.line_radio {
			width: 20rpx;
			height: 20rpx;
			border-radius: 50%;
			position: relative;
			left: 50%;
			transform: translateX(-50%);
			top: 0;
		}

		.right_box {
			padding: 0rpx 20rpx 20rpx 20rpx;
		}

		.desc {
			font-size: 30rpx;
			color: #8e8b8d;
			display: flex;
			margin-top: 20rpx;
			align-items: center;

		}

	}
</style>
